import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.awt.*;

/**
 * Write a description of class Scorepc here.
 * 
 * Solo muestra las vidas y el puntaje de PC
 */
public class Scorepc extends Score
{
    private static final String Name = "PC ";
    private static final String scoreLabel = "Puntos: ";
    private static final String livesLabel = "Vidas: ";
    private static int scor = 0;
    private static int lives = 0;
    
    private GreenfootImage box;
    
    public Scorepc() {
        box = new GreenfootImage (105, 59);
        
        box.setColor(new Color (0.5f,0.5f,0f,1f));
        box.fillRect (0,0, 200, 60);

        updateS (0);
    }
    
    public void act() {
        Aspire w = (Aspire)getWorld();
        scor = w.getScorep();
        lives = w.getLivesPc();
        updateS (scor);
    }
    
    public void updateS (int score)
    {
        GreenfootImage img = new GreenfootImage (box);
        
        img.setColor (Color.YELLOW);
        img.setFont(new Font("SANS_SERIF", 0, 16));
        img.drawString(Name, 5, 15);
        img.drawString(scoreLabel + scor, 5, 32);
        img.drawString(livesLabel + lives, 5, 49);
        setImage (img);
    }
}